package com.aloda.api.client;

import com.aloda.api.domain.Question;
import com.aloda.api.domain.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author aloda
 * @Date 2025/4/29 14:45
 */
@FeignClient("oj-question")
public interface QuestionClient {

    /**
     * 通过id获取题目信息
     * @param id
     * @return
     */
    @GetMapping("/question/inner/{id}")
    Question getById(@PathVariable Long id);

    /**
     * 新增通过数量
     * @param id
     */
    @PutMapping("/question/inner/{id}")
    void addAcceptedNum(@PathVariable Long id);

    /**
     * 通过id获取答题记录
     * @param id
     * @return
     */
    @GetMapping("/question/submit/inner/{id}")
    QuestionSubmit getQuestionSubmitById(@PathVariable Long id);

    /**
     * 更新答题记录
     * @param questionSubmit
     */
    @PutMapping("/question/submit/inner")
    boolean updateQuestionSubmit(@RequestBody QuestionSubmit questionSubmit);
}
